home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gsdll.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  4.0 KB  |  125 lines

  1. /* Copyright (C) 1994-1996, Russell Lang.  All rights reserved.
  2.   Portions Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
  3.   
  4.   This file is part of AFPL Ghostscript.
  5.   
  6.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  7.   distributor accepts any responsibility for the consequences of using it, or
  8.   for whether it serves any particular purpose or works at all, unless he or
  9.   she says so in writing.  Refer to the Aladdin Free Public License (the
  10.   "License") for full details.
  11.   
  12.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  13.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  14.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  15.   conditions described in the License.  Among other things, the License
  16.   requires that the copyright notice and this notice be preserved on all
  17.   copies.
  18.  */
  19.  
  20.  
  21. /*$Id: gsdll.h,v 1.2 2000/09/19 19:00:27 lpd Exp $ */
  22.  
  23. #ifndef gsdll_INCLUDED
  24. #  define gsdll_INCLUDED
  25.   
  26. #ifdef __MACINTOSH__
  27.  
  28. #define HWND char *
  29. #define GSFAR 
  30. #include <QDOffscreen.h>
  31. #pragma export on
  32.  
  33. #endif
  34.  
  35. #ifndef GSDLLEXPORT
  36. #define GSDLLEXPORT
  37. #endif
  38.  
  39. #ifdef __WINDOWS__
  40. #define _Windows
  41. #endif
  42.  
  43. /* type of exported functions */
  44. #ifdef _Windows
  45. #ifdef _WATCOM_
  46. #define GSDLLAPI GSDLLEXPORT
  47. #else
  48. #define GSDLLAPI CALLBACK GSDLLEXPORT
  49. #endif
  50. #else
  51. #ifdef __IBMC__
  52. #define GSDLLAPI _System
  53. #else
  54. #define GSDLLAPI
  55. #endif
  56. #endif
  57.  
  58. #ifdef _Windows
  59. #define GSDLLCALLLINK
  60. #define GSFAR FAR
  61. #else
  62. #ifdef __IBMC__
  63. #define GSDLLCALLLINK _System
  64. #else
  65. #define GSDLLCALLLINK
  66. #endif
  67. #define GSFAR
  68. #endif
  69.  
  70. /* global pointer to callback */
  71. typedef int (GSFAR * GSDLLCALLLINK GSDLL_CALLBACK) (int, char GSFAR *, unsigned long);
  72. extern GSDLL_CALLBACK pgsdll_callback;
  73.  
  74. /* message values for callback */
  75. #define GSDLL_STDIN 1        /* get count characters to str from stdin */
  76.             /* return number of characters read */
  77. #define GSDLL_STDOUT 2        /* put count characters from str to stdout */
  78.             /* return number of characters written */
  79. #define GSDLL_DEVICE 3        /* device = str has been opened if count=1 */
  80.             /*                    or closed if count=0 */
  81. #define GSDLL_SYNC 4        /* sync_output for device str */
  82. #define GSDLL_PAGE 5        /* output_page for device str */
  83. #define GSDLL_SIZE 6        /* resize for device str */
  84.             /* LOWORD(count) is new xsize */
  85.             /* HIWORD(count) is new ysize */
  86. #define GSDLL_POLL 7        /* Called from gp_check_interrupt */
  87.             /* Can be used by caller to poll the message queue */
  88.             /* Normally returns 0 */
  89.             /* To abort gsdll_execute_cont(), return a */
  90.             /* non zero error code until gsdll_execute_cont() */
  91.             /* returns */
  92.  
  93. /* return values from gsdll_init() */
  94. #define GSDLL_INIT_IN_USE  100    /* DLL is in use */
  95. #define GSDLL_INIT_QUIT    101    /* quit or EOF during init */
  96.                   /* This is not an error. */
  97.                   /* gsdll_exit() must not be called */
  98.  
  99.  
  100. /* DLL exported  functions */
  101. /* for load time dynamic linking */
  102. int GSDLLAPI gsdll_revision(char GSFAR * GSFAR * product, char GSFAR * GSFAR * copyright, long GSFAR * gs_revision, long GSFAR * gs_revisiondate);
  103. int GSDLLAPI gsdll_init(GSDLL_CALLBACK callback, HWND hwnd, int argc, char GSFAR * GSFAR * argv);
  104. int GSDLLAPI gsdll_execute_begin(void);
  105. int GSDLLAPI gsdll_execute_cont(const char GSFAR * str, int len);
  106. int GSDLLAPI gsdll_execute_end(void);
  107. int GSDLLAPI gsdll_exit(void);
  108. int GSDLLAPI gsdll_lock_device(unsigned char *device, int flag);
  109.  
  110. /* Function pointer typedefs */
  111. /* for run time dynamic linking */
  112. typedef int (GSDLLAPI * PFN_gsdll_revision) (char GSFAR * GSFAR *, char GSFAR * GSFAR *, long GSFAR *, long GSFAR *);
  113. typedef int (GSDLLAPI * PFN_gsdll_init) (GSDLL_CALLBACK, HWND, int argc, char GSFAR * GSFAR * argv);
  114. typedef int (GSDLLAPI * PFN_gsdll_execute_begin) (void);
  115. typedef int (GSDLLAPI * PFN_gsdll_execute_cont) (const char GSFAR * str, int len);
  116. typedef int (GSDLLAPI * PFN_gsdll_execute_end) (void);
  117. typedef int (GSDLLAPI * PFN_gsdll_exit) (void);
  118. typedef int (GSDLLAPI * PFN_gsdll_lock_device) (unsigned char GSFAR *, int);
  119.  
  120. #ifdef __MACINTOSH__
  121. #pragma export off
  122. #endif
  123.  
  124. #endif /* gsdll_INCLUDED */
  125.